package com.wen.chainPattern;

/**
 * 测试类
 */
public class Clinet {
    public static void main(String[] args) {
        Handler grandMaHandler = new GrandMaHandler("1");
        Handler grandPaHandler = new GrandPaHandler("2");
        Handler montherHandler = new MontherHandler("3");
        Handler fatherHandler = new FatherHandler("4");
        grandMaHandler.setNextHandler(grandPaHandler);
        grandPaHandler.setNextHandler(montherHandler);
        montherHandler.setNextHandler(fatherHandler);
        grandMaHandler.dealMessage("5","孙子/儿子请求出去玩耍");
    }
}
